package cn.wuzongbo.tes.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.wuzongbo.tes.po.ArticleCate;
import cn.wuzongbo.tes.po.ArticleCateExample;
import cn.wuzongbo.tes.service.ArticleCateService;

@Controller
@RequestMapping("/articlecate")
public class ArticleCateController {
	@Autowired
	private ArticleCateService articleCateService;
	@RequestMapping("index.do")
	public String index(Model model,ArticleCate cate){
		ArticleCateExample articleCateExample=new ArticleCateExample();
		
		ArticleCateExample.Criteria criteria=articleCateExample.createCriteria();
		
	
		criteria.andStatusEqualTo((byte)1);
		if(cate.getCateName()!=null){
			criteria.andCateNameLike("%"+cate.getCateName()+"%");
			
		}
		
		
		
		List<ArticleCate> articleCates=articleCateService.query(articleCateExample);
		
		model.addAttribute("articleCates", articleCates);
		
		return "admin/articlecate/list";
		
	}
		

}
